<template>
  <div class="warp">
    <!-- 搜索栏 -->
    <!-- <div class="searchBar_wrap">
      <van-search :value="serValue" placeholder="请输入职位" background="#800080" shape="round" use-action-slot @search="onSearch">
      </van-search>
    </div> -->
    <!-- 条件栏 -->
    <div class="top-nav">
      <div @click="changeVanShow(0)"><span>地点</span><span>{{area}}</span></div>
      <div @click="changeVanShow(1)"><span>职位</span><span>前端</span></div>
      <div><span>经验</span><span>1年</span></div>
      <div><button>搜索</button></div>
    </div>
    <!--<van-popup v-model="vanShow">
      <van-area v-if="navFlag==0" :area-list="areaList" :columns-num="3" title="地区" value="440100" @cancel="changeVanShow" @confirm="setArea" />
      <div v-if="navFlag==1">
        <div class="position-wrap">
          <div class="position-left">
            <span v-for="(item,index) in positionList" :key="index" @click="jobFlagC(index)">{{item.listName}}</span>
          </div>
          <div class="position-right">
            <span v-for="(item,index) in posDelList" :key="index" @click="onFlag(item)">{{item}}</span>
          </div>
        </div>
        <div class="selBox"><span v-for="(item,index) in flag" :key="index" @click="delFlag(item)">{{item}}</span></div>
        <div class="onButton"><span class="but-l" @click="reset">重置</span><span class="but-r">搜索</span></div>
      </div>
    </van-popup> -->
    <!-- 招聘栏 -->
    <div class="recruit_wrap" :class="showPopup==true?'posF':''">
      <div class="title-bar">
        <span>职位</span>
        <span>公司</span>
        <span>地址</span>
        <span>薪资</span>
        <span>经验</span>
      </div>
      <div class="recruitItem" v-for="(item,index) in returesListrn " :key="index">
        <div class="companyInfo_label">
          <span class="text-left">{{item.job}}</span>
          <span class="text-left">{{item.company}}</span>
          <span>{{item.region}}</span>
          <span class="purpleColor">{{item.pay}}/月</span>
          <span>{{item.experience}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import areaListJS from '../assets/js/area.js'
  import position from "../assets/js/position.js"
  export default {
    data() {
      return {
        flag: [],
        posDelList: [],
        positionList: position.position_list,
        navFlag: '',
        area: "广州",
        vanShow: false,
        areaList: areaListJS,
        showPopup: false,
        returesListrn: [{
          job: "web前端开发工程师",
          company: "阿里巴巴集团控股有限公司",
          nature: "民营",
          education: "大专",
          experience: "2年",
          pay: "0.8-1w",
          region: "天河区",
          time: "今天"
        }, {
          job: "JAVA后台开发工程师",
          company: "深圳市腾讯计算机系统有限公司",
          nature: "民营",
          education: "本科",
          experience: "3年",
          pay: "1-1.2w",
          region: "南沙区",
          time: "昨天"
        }, {
          job: "web前端开发工程师",
          company: "阿里巴巴集团控股有限公司",
          nature: "民营",
          education: "大专",
          experience: "2年",
          pay: "0.8-1w",
          region: "天河区",
          time: "今天"
        }, {
          job: "JAVA后台开发工程师",
          company: "深圳市腾讯计算机系统有限公司",
          nature: "民营",
          education: "本科",
          experience: "3年",
          pay: "1-1.2w",
          region: "南沙区",
          time: "昨天"
        }, {
          job: "web前端开发工程师",
          company: "阿里巴巴集团控股有限公司",
          nature: "民营",
          education: "大专",
          experience: "2年",
          pay: "0.8-1w",
          region: "天河区",
          time: "今天"
        }, {
          job: "JAVA后台开发工程师",
          company: "深圳市腾讯计算机系统有限公司",
          nature: "民营",
          education: "本科",
          experience: "3年",
          pay: "1-1.2w",
          region: "南沙区",
          time: "昨天"
        }, {
          job: "web前端开发工程师",
          company: "阿里巴巴集团控股有限公司",
          nature: "民营",
          education: "大专",
          experience: "2年",
          pay: "0.8-1w",
          region: "天河区",
          time: "今天"
        }, {
          job: "JAVA后台开发工程师",
          company: "深圳市腾讯计算机系统有限公司",
          nature: "民营",
          education: "本科",
          experience: "3年",
          pay: "1-1.2w",
          region: "南沙区",
          time: "昨天"
        }],
      }
    },
    // 初始化
    computed: {},
    methods: {
      changeVanShow(e) {
        this.navFlag = e
        this.vanShow = !(this.vanShow)
      },
      setArea(e) {
        this.changeVanShow();
        this.area = e[1].name + '-' + e[2].name
      },
      reset() {
        this.flag = []
      },
      jobFlagC(e) {
        this.jobFlag = e;
        this.posDelList = this.positionList[e].list
      },
      onFlag(e) {
        if (this.flag.indexOf(e) == -1 && this.flag.length < 5) {
          this.flag.push(e);
        }
      },
      delFlag(e) {
        this.flag.splice(this.flag.indexOf(e), 1)
      },
    }
  }
</script>

<style scoped>
  .purpleColor {
    color: #800080
  }
  .text-left {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .warp {
    width: 100%;
  }
  .searchBar_wrap {
    padding: 0.2rem;
    background-color: #800080;
  }
  .top-nav {
    padding: 1rem 0 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #800080;
  }
  .top-nav div {
    width: 15%;
    display: flex;
    flex-direction: column;
    background: #fff;
  }
  .position-wrap {
    padding: 0.5rem 0;
    text-align: center;
    display: flex;
  }
  .position-left {
    display: flex;
    flex-direction: column;
    background: #fff;
  }
  .position-left span {
    width: 15rem;
    border-bottom: 0.01rem solid #E7E7E7;
  }
  .position-right {
    width: 15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F5F5F5;
    padding: 0.1rem 0;
  }
  .position-right span {
    color: #800080;
    margin: 0.1rem 0;
    width: 68%;
    background: #fff;
    padding: 0.15rem;
    border: 0.01rem solid #E4E4E4;
    border-radius: 0.2rem;
  }
  .selBox {
    text-align: center;
    background: #F5F5F5;
    padding: 0.05rem 0;
    display: flex;
    justify-content: left;
  }
  .selBox span {
    margin-left: 0.2rem;
    font-size: 1rem;
    width: 19%;
    background-color: #800080;
    color: #fff;
    border: 0.01rem solid #E4E4E4;
    border-radius: 0.2rem;
  }
  .onButton {
    display: flex;
  }
  .onButton span {
    padding: 0.2rem;
    border: 0.02rem solid #F5F5F5;
    width: 49.5%;
  }
  .but-l {
    background: #fff;
  }
  .but-r {
    color: #fff;
    background: #800080;
  }
  .recruit_wrap {
    text-align: center;
    padding: 0 10%;
  }
  .title-bar {
    display: flex;
    width: 100%;
    border-bottom: 0.01rem solid #EBEBEB;
  }
  .title-bar span {
    width: 20%;
  }
  .posF {
    position: fixed;
  }
  .recruitItem {
    display: flex;
    justify-content: space-around;
    padding: 0.16rem 0;
    border-bottom: 0.01rem solid #EBEBEB;
    line-height: 128%;
  }
  .companyInfo_label {
    width: 100%;
    display: flex;
  }
  .companyInfo_label span {
    width: 25%;
  }
</style>
